Ext.define('Fxt.stl-sell.view.Grid', {
    extend: 'Fxt.core.view.Grid',
    model: 'Fxt.stl-sell.Model',
    $selModel: 'MULTI',
    $audit: false,
    $newStore: function() {
        return Ext.create('Fxt.stl-sell.Store')
    },
    tbar: [{
        xtype: 'splitbutton',
        text: '新增卖出账号',
        action: 'new-sell',
        menu:[]
    }, {
        text: '新增卖出账号(系统选下一个账号)',
        action: 'new-sell-auto-pay-account'
    }, '===================', {
        text: '同步交易状态',
        action: 'sync-sell-jy-status'
    }, {
        text: '卖币',
        action: 'make-sell-jy'
    }, {
        text: '取消卖出',
        action: 'cancel-sell'
    }, {
        xtype: 'splitbutton',
        text: '强制设置支付宝',
        action: 'force-set-sell-new-alipay',
        menu:[]
    }],
    columns: [{
        text: '小号',
        dataIndex: 'mobile'
    }, {
        text: '支付宝账号',
        dataIndex: 'alipayMobile'
    }, {
        text: '支付宝姓名',
        dataIndex: 'alipayRealName'
    }, {
        text: '支付宝昵称',
        dataIndex: 'alipayNickname'
    }, {
        text: '状态',
        dataIndex: 'jyStatus',
        renderer: function(value, meta, record) {
            var status = record.get('status');
        	if (status == 'Waiting_Buyer_Pay') {
        		meta.style = 'color:#209CEE;';
        	} else if (status == 'Waiting_Seller_Confirm') {
        		meta.style = 'color:#22C65B;';
        	}
        	return value;
        }
    }, {
        text: '交易单号',
        dataIndex: 'jyId'
    }, {
        text: '买家',
        dataIndex: 'buyerMobile'
    }, {
        text: '已成功单数',
        dataIndex: 'successQty'
    }, {
        text: '金额',
        dataIndex: 'jyAmount'
    }, {
        text: '支付凭证',
        dataIndex: 'jyPayImgUrl',
        renderer: function(url) {
            if (url == null || url == '') {
                return url;
            }
            return '<a target="_blank" href="javascript:;">' + url + '</a>'
        }
    }, {
        text: 'jyTime',
        dataIndex: 'jyTime'
    }, {
        text: '操作人',
        dataIndex: 'owner'
    }, {
        text: '确认人',
        dataIndex: 'confirmBy'
    }, {
        text: '小号实名',
        dataIndex: 'realName'
    }, {
        text: '状态',
        dataIndex: 'status'
    }, {
        text: 'jyQty',
        dataIndex: 'jyQty'
    }, {
        text: '创建时间',
        dataIndex: 'insertTime'
    }]
});